<?php
if (isset($_GET["org_nid"])) {
    $con = mysql_connect("localhost", "_fundraising", "8bb9f7ea");
    mysql_select_db("_fundraising");
    $query = 'SELECT * FROM content_type_sale_campaign, node 
            WHERE content_type_sale_campaign.field_campaign_org_nid = ' . $_GET["org_nid"] .
            ' AND content_type_sale_campaign.nid = node.nid';
    $result = mysql_query($query) or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
        $select[] = array("id" => $row['nid'], "title" => $row['title']);
    }
    echo json_encode($select);
}
